package com.yz.lzq.liwushuo.base;

import rx.Subscription;
import rx.subscriptions.CompositeSubscription;

/**
 * Created by wanggang on 2016/11/22.
 */

public class BaseCommPresenter {
    private CompositeSubscription subscription = new CompositeSubscription();

    public void addSub(Subscription sub) {
        if (sub != null && !sub.isUnsubscribed()) {
            subscription.add(sub);
        }
    }

    public void unSub() {
        if (subscription.hasSubscriptions()) {
            subscription.unsubscribe();
        }
    }
}
